/*
 * File:   Box2dBody.h
 * Author: Elevator
 *
 * Created on 24 Май 2013 г., 21:36
 */

#ifndef PHYSICS_BOX2DBODY_H
#define PHYSICS_BOX2DBODY_H

#include "Common/Common.h"
#include "Physics/Colliders/ICollider.h"
#include "Physics/Colliders/Box2dCollider.h"
#include "IBody.h"

class b2Body;

namespace physics {

	class Box2dBody : public IBody {
	public:
		Box2dBody( b2Body* body );
		virtual ~Box2dBody( );

		virtual void SetVel( const Transform& vel );
		virtual Transform GetVel( ) const;

		virtual void SetPos( const Transform& pos );
		virtual Transform GetPos( ) const;

		virtual float GetMass( ) const;
		virtual void SetMass( float mass );

		virtual float GetInertia( ) const;
		virtual void SetInertia( float inertia );

		virtual Type GetType( ) const;
		virtual void SetType( Type value );

		virtual IIterable<const ICollider*>* GetColliders( ) const;
		virtual ICollider* CreateCollider( float friction, float restitution, const IShape* shape );
		virtual void DestroyCollider( ICollider* collider );

		b2Body* GetBox2dBody( );

	private:
		b2Body* _body;
		Vector<const ICollider*> _colliders;
	};
}
#endif	/* BOX2DBODY_H */

